import React from 'react'
import { connect } from 'react-redux'
import { addAction } from '../store/actions'
function home(props) {
    return (
        <div>
            {props.num}
            <button onClick={() => props.add()}>点击</button>
        </div>
    )
}
const getState = (state) => {
    return {
        num: state.num
    }
}

const putDispatch = (dispatch) => {
    return {
        add() {
            dispatch(addAction())
        }
    }
}

export default connect(getState, putDispatch)(home)